﻿@model B4Deal.Models.Deal
@{
    ViewBag.Title = "Chi tiết khuyến mãi";
    var per = (Model.DonGiaCu - Model.DonGiaMoi) * 100 / Model.DonGiaCu;
    var time = Convert.ToDateTime(Model.KetThucKM).DayOfYear - DateTime.Now.DayOfYear;
    var fb = "www.b4deal.somee.com/home/detaildeal/" + Model.MaKM.ToString();
}
<link href="@Url.Content("~/Content/Layout/Product.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Layout/style.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Layout/jquery.countdown.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/js/webwidget_slideshow_html5_simple.js")" type="text/javascript"></script>
@{
    var dir = Model.HinhAnh.Substring(0, Model.HinhAnh.IndexOf('.'));
    var comments = Model.QueryCommentByDealID();
    var business = Model.QueryBusinessByDealID();
    var strSub = business.DiaChi.Replace(' ', '+');
    var strGoogle = "http://maps.google.com/maps?z=18&q=" + strSub;
    dir = Model.HinhAnh.Substring(0, Model.HinhAnh.LastIndexOf('/'));
}

<script type="text/javascript" src="@Url.Content("~/Scripts/js/slide.js")"></script>
<div class="body-content" style="padding-bottom: 15px;" align="left">
    <div class="body-left" style="z-index: 3; position: relative">
        <header>
        
            <div id="dIsGoldDeal" class="module-rad">
                <div id="DealInfo" itemtype="http://schema.org/Product" itemscope="">
                    <span class="shadow-module"></span>
                    <div class="title-detail">
                        <a style="color:#fff" href="javascript:void()">
                            <h1 itemprop="name">@Model.TenKM: </h1>
                        </a>
                         <div itemprop="description" style="display:inline">
                            <p style="text-align: justify;">
                                @Model.MoTa
                                . Chỉ có tại B4Deal.
                            </p>
                        </div>
                        <div itemtype="http://schema.org/AggregateRating" itemscope="" itemprop="aggregateRating">
                            <meta content="5" itemprop="ratingValue"/>
                            <meta content="14" itemprop="reviewCount"/>
                        </div>
                    </div>
                    <div class="module-inner" itemtype="http://schema.org/Offer" itemscope="" itemprop="offers">
                        <div class="right-detail">
                            <i class="bg"></i>
                            <div class="right-detail-inner">
                                <p class="price-sale">
                                    <span itemprop="price">@{var money = String.Format("{0:0,0}", Model.DonGiaMoi);}@money</span>
                                    <i content="VND" itemprop="priceCurrency"> VNĐ</i>
                                </p>
                                <p class="hdbutton">
                                    <a class="button button-ta" name="" onclick = "Add2Cart(@Model.MaKM)" href="javascript:void()">
                                        <span>Mua</span>
                                    </a>
                                </p>
                                <p class="price-org">
                                    Giá gốc:
                                    <del>@{var root = String.Format("{0:0,0}", Model.DonGiaCu);}@root</del>
                                    <i>VNĐ</i>
                                </p>
                                <div class="bg-save-amo-time">
                                    <div class="save-amo-time">
                                        <span class="save">
                                            <i class="icon"></i>
                                            <i class="text">@per 
                                            %</i>
                                        </span>
                                        <i class="line"></i>
                                        <span class="amo">
                                            <i class="icon"></i>
                                            <i class="text">@Model.NNguoi</i>
                                        </span>
                                        <i class="line"></i>
                                        <span class="time">
                                            <i class="icon"></i>
                                            <i id="Time_CountDown_5781" class="text">@time ngày</i>
                                        </span>
                                    </div>
                                </div>
                                <div class="bg-progess-bar">
                                    <div style="width:78%">
                                        <span></span>
                                        <i></i>
                                    </div>
                                </div>
                                <span class="bot-bg-price">
                                    <i>Vẫn còn mua được</i>
                                </span>
                            </div>
                            <link href="http://schema.org/InStock" itemprop="availability"/>
                            <div id="fb-root"></div>
<script>    (function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=118218024951303";
        fjs.parentNode.insertBefore(js, fjs);
    } (document, 'script', 'facebook-jssdk'));</script>
    <div align="center">
                            <div class="fb-like" data-href="@fb" data-send="true" data-layout="button_count" data-show-faces="true" data-width="120"></div>
                        </div>
                        </div>
                    
                        <div class="img-detail" align="center">
                         <table>
            <tr>
              <td id="showinfo"></td>
            </tr>
            <tr>
                <td>
                    <div id="webwidget_slideshow_html5_simple">
                        <ul>
                             @{
                                for (int i = 1; i < 6; i++)
                                {
                                    var temp = dir + "/" + i.ToString() + ".jpg";
                                    <li><a href="#"><img src="@temp" style="width:100px; height:85px" alt="@i" /></a></li>
                                }
                            }
                        </ul>
                    </div>
                </td>
            </tr>
        </table>
        <script language="javascript" type="text/javascript">
            $(function () {
                $("#webwidget_slideshow_html5_simple").webwidget_slideshow_html5_simple({
                    slideshow_transition_effect: 'Mosaic,Wipe_from_horizontal_blind,Wipe_from_vertical_blind,Wipe_from_vertical_center,Wipe_from_horizontal_center,Wipe_to_horizontal_center,Wipe_to_vertical_center,Wipe_from_bottom_to_top,Wipe_from_top_to_bottom,Wipe_from_right_to_left', //slide_left slide_down fade_in
                    slideshow_time_interval: '4000',
                    slideshow_window_width: '420',
                    slideshow_window_height: '350',
                    slideshow_background_color: '#FFF',
                    slideshow_border: '#999 solid 2px',
                    text_effect: 'text_fade'
                });
            });
        </script>  
     
  
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            

            <div class="module-rad module-rad-w rad-no-bot">
                <i class="left-cor"></i>
                <i class="right-cor"></i>
                <div id="dCondition" class="module-inner">
                	<ul class="highlights-cond">
                        <li>
                            <h2 class="title">điểm nổi bật</h2>
                            <div id="highlights-deal">
                            	<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-right: 0px; padding-left: 0px; list-style-type: none; font-size: 13px; color: rgb(0, 0, 0); font-family: arial; text-align: left; ">
                                @{
                                    string[] sub = Model.DacDiemNoiBat.Split('-');
                                    foreach (var str in sub)
                                    {
                                         <li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 14px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial; color: rgb(80, 80, 80); line-height: 18px; text-align: justify; ">@str</li>
                                    }
                                }
                                </ul>
                            </div>
                        </li>
                        <li class="line"></li>
                        <li>
                            <h2 class="title">điều kiện</h2>
                            <div id="condi-deal">
                                <p>
                                    <strong>VOUCHER TRỊ GIÁ @Model.DonGiaMoi VNĐ</strong>
                                </p>
                                <ul>
                                @{
                                    sub = Model.DkSuDung.Split('-');
                                    foreach (var str in sub)
                                    {
                                        <li style="text-align: justify; ">@str</li>
                                    }
                                }
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </header>
        <section class="module-rad module-rad-b rad-no-bot">
        <div>
            <i class="left-cor"></i>
            <i class="right-cor"></i>
            <div class="module-inner">
                <div id="dListCompanyInfo" class="trading-places">
                    <h3 itemprop="name">@Model.TenKM</h3>
                    <em itemprop="reviewer">
                    	<a target="_blank" href="javascript:void()"></a>
                    </em>
                    <br>
                    <em class="line"></em>
                    <ul class="points">
                    	<li>
                            <p>
                                <span itemprop="tel">
                                    @business.DiaChi
                                </span>
                                <span itemprop="tel">Điện thoại: 01667319803</span>
                                <a target="_blank" itemprop="url" name="" href="@strGoogle">Đến điểm này</a>
                            </p>   
                        </li>
                    </ul>
                    <em class="line"></em>
                    <!--ul class="menu-price">
                    	<li>
                        	<a target="_blank" href= "javascript:void()" @* "http://www.nhommua.net/Upload/5781/Menu/Thuc-Don-NHA_HANG_NEM_VUONG_05_2012_2012523152147283.jpg" *@>
                                <i></i>
                                Thực Đơn
                            </a>
                        </li>
                    </ul-->
                </div>
                <div class="descriptions">
                    <article>
                        <div id="dGioiThieu" class="descriptions-inner">
                        	<div id="PRContent">
                                <p style="text-align: center;">
                                    <strong>
                                    	<em>@Model.MoTa</em>
                                    </strong>
                                </p>
                                @{
                                    sub = Model.GioiThieuChiTiet.Split('-');
                                    foreach (var str in sub)
                                    {
                                        <p style="text-align: justify;">@str</p>
                                    }
                                }
                               </div>
                        </div>
                        <address style="font-size:0px">
                            Viết bởi
                            <em>B4Deal</em>
                            .
                        </address>
                    </article>
                    <i class="line"></i>
                    <div class="bot-descriptions">
                        <a id="aTotalCommentBot" href="javascript:void()">
                            <span class="comments">
                                <strong>@comments.Count</strong>
                                lời bình
                            </span>
                        </a>
                        <div id="dShareBott" class="share">
                        	
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </section>
        @{
            
            @Html.Partial("_Comment", comments);
        }
        <section class="module-gra">
            <div id="dBuyBottom" class="bg-module-gra">
                <div class="price-save-amo-time">
                    <span class="price">
                        <i class="icon">giá còn lại</i>
                        <i class="text">
                            @money
                            <i class="curency">VNĐ</i>
                        </i>
                    </span>
                    <i class="line"></i>
                    <span class="save">
                        <i class="icon">@per<strong>%</strong></i>
                    </span>
                    <i class="line"></i>
                    <span class="amo">
                        <i class="icon">@Model.NNguoi</i>
                    </span>
                    <i class="line"></i>
                    <span class="time">
                        <i id="Time_CountDown_0" class="icon">@time ngày</i>
                    </span>
                </div>
                <i class="line"></i>
                <p class="mnbutton">
                    <a class="button button-sh" name="" onclick = "Add2Cart(@Model.MaKM)" href= "javascript:void()">
                        <span>Mua</span>
                    </a>
                </p>
            </div>
        </section>
    </div>
    <aside class="right-menu">      
        <div id="divSideDeal" class="right-menu-price">
            <h3>Giá tốt cùng loại</h3>
            @{
                var sideDeal = Model.QueryDealByType(Model.LoaiKM);
                foreach (var deal in sideDeal)
                {
                    @Html.Partial("_SideDeal", deal);
                }
            }               
        </div>
    </aside>
</div>
